package temp;

import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Timestamp;
import java.util.HashMap;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;

public class Test1 {
	
	public static void main(String[] args) {
		
//		StringUtils.
//		String escapeJava = org.apache.commons.lang.StringEscapeUtils.escapeJava("fdfsfsfs");
//		System.out.println(escapeJava);
		
		
//		String escapeHtml = StringEscapeUtils.escapeHtml("<html>Yahoo</html>");
//		System.out.println(escapeHtml);
		
//		String replace = StringUtils.replace("idii", "i", "I", 1);
//		System.out.println(replace);
		
		
//		String getter = getGetter("name");
//		System.out.println(getter);
		
//		HashMap map=new HashMap();
//		System.out.println(map instanceof Serializable);
		
		
//		Timestamp timestamp = new Timestamp(1237803383000L-(new Long(744).longValue()* 60L * 60L * 1000L));
//		System.out.println(timestamp);
		
//		Class clazz=boolean.class;
//		System.out.println(clazz.getSimpleName());
		
		Class clazz = User.class;
		try {
			Field field = clazz.getField("isOk");
			System.out.println(field.getType().getName());
			
			Method[] methods = clazz.getMethods();
			for (Method method : methods) {
				System.out.println(method);
			}
			
//			System.out.println("java.lang.InterruptedException");
		} catch (SecurityException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NoSuchFieldException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public static String getGetter(String propertyName)
	{
		if(propertyName==null||propertyName.equals(""))
			return null;
		String startChar=propertyName.substring(0, 1);
		return "get"+StringUtils.replace(propertyName, startChar, startChar.toUpperCase(), 1);
	}

}

class User{
	public Boolean isOk;
	
	public void getInfo(){
		
	}
	public void getInfo(String name){
		
	}
}
